/*
 * @Author: xiawang1024
 * @Date: 2023-04-10 15:41:02
 * @LastEditTime: 2023-04-10 17:55:04
 * @LastEditors: xiawang1024
 * @Description:
 * @FilePath: /rollup-lib/rollup.config.mjs
 * 工作，生活，健康
 */
import path from 'path'
import { babel } from '@rollup/plugin-babel'
import json from '@rollup/plugin-json'
import resolve from '@rollup/plugin-node-resolve'
import commonjs from '@rollup/plugin-commonjs'
import builds from './config/builds.mjs'
import { fileURLToPath } from 'url'

const __filename = fileURLToPath(import.meta.url)
const __dirname = path.dirname(__filename)

export default {
  input: path.join(__dirname, '/src/index.js'),
  output: builds,
  plugins: [
    resolve(),
    commonjs({
      transformMixedEsModules: true,
    }),
    json(),
    babel({
      exclude: 'node_modules/**',
      babelHelpers: 'runtime',
    }),
  ],
}
